Repository navigation
Conversation
Refuse more than ROLE_HISTORY_LIMIT changed suggestions before any role PUT so a recorded operation remains one listable history batch. Preserve server-issued batch reuse for accepted operations. Report confirmed writes, an unconfirmed role, unattempted roles and the known batch before propagating the original failure. Do not replay or roll back a request whose response may have been lost. Add real-handler coverage for the 50/51 boundary, whole-batch restore, no-op exclusions, partial refusal and lost acknowledgements. Document the apply limit and recovery contract.
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Apply safeguards and reporting src/cli/agent.ts, docs-site/src/content/docs/reference/cli/agents.md, structure/cli-management.md, docs-site/src/content/docs/guides/integrations.md, docs-site/src/content/docs/ja/guides/integrations.md, docs-site/src/content/docs/ko/guides/integrations.md, docs-site/src/content/docs/ru/guides/integrations.md, docs-site/src/content/docs/zh-cn/guides/integrations.md |
The CLI rejects applies with more than 50 changed roles before sending updates. Accepted changes use the server-issued batch. On interruption, the CLI reports confirmed, unconfirmed, and unattempted roles and preserves the original error. The documentation describes the limit and recovery behavior. |
History apply validation tests/cli/cli-role-suggestion-history.test.ts, tests/cli/cli-headless-parity.test.ts, scripts/test-layout/layout.json, tests/fixtures/test-layout-expected.json |
Tests cover the limit, excluded roles, previews, batch restoration, and partial or uncertain writes. The headless parity fixture expects the batch in role updates. Test-layout mappings include the new history test. |
Estimated code review effort: 3 (Moderate) | ~20 minutes
Change: Bug fix
Sequence Diagram(s)
sequenceDiagram
participant AgentCLI
participant ManagementAPI
AgentCLI->>ManagementAPI: Submit changed role update
ManagementAPI-->>AgentCLI: Return server-issued history batch
loop Remaining changed roles
AgentCLI->>ManagementAPI: Submit next update with batch
ManagementAPI-->>AgentCLI: Return write result
end
Possibly related PRs
- lidge-jun/opencodex#7693: Adds the role-model history journal and batch grouping that this change uses for role-suggestion applies.
Suggested reviewers: lidge-jun, ingwannu
Merge Risk: 
Minimal · up to a92af
-
No merge-blocking issue was identified. Proceed with normal checks.
Pre-merge checks: 
4 · 
1
-
Failed checks: 1 warning Passed checks: 4 passed-
Full details: Title check
-
Explanation
The title clearly identifies the main change: preserving the server-issued batch for
ocx agent roles suggest --apply. This matches the implementation and the PR objective. The additional limit and recovery behavior does not need to appear in the title.
-
Full details: Docstring Coverage
-
Explanation
Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 6 functions across 3 files. (9 skipped: 9 unsupported.)
Resolution
Write docstrings for the functions missing them to satisfy the coverage threshold.
-
Finishing Touches
-
🧪 Generate unit tests (beta)
-
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Comment @coderabbitai help to get the list of available commands.
|
✅ Deterministic PR hygiene checks passed. |
|
Maintainer dev-integration decision: the owner (@lidge-jun) authorized admin integration of this PR into
Cross-platform coverage comes from the batched |
Summary
Preserve the server-issued batch ID across
ocx agent roles suggest --applywrites so one Apply-all operation can be restored as one history batch. Refuse more than 50 applicable changed roles before any write; exclude unchanged, unsized and unassigned proposals. Preserve original nonzero errors for partial or unconfirmed outcomes without retrying or rolling back uncertain writes.Japanese, Korean, Russian and Simplified Chinese guides now document the 50-change cap, exit 5 no-write refusal, exclusions, per-role set fallback and canonical recovery contract.
Migrated from luvs01/opencodex#798 without changing HEAD
a92afee2fba53ce2115b428294ada7013e198c94. This includes observed current devc34d26ff2bde9516517fe7fd58c2bcda70ca5e03; unique delta is 12 files. No GUI changes or live role/config updates are included in this submission.Verification
tests/cli/cli-role-suggestion-history.test.tsandtests/cli/cli-headless-parity.test.ts. Coverage exercises real management handlers/private on-disk role history: one batch across 50 writes and restore, 51 applicable changes refused before writes, excluded no-op proposals, partial failure preserving the original error, and lost acknowledgement without retries/rollback.Checklist
Upstream readiness
Initially submitted Draft. Exact upstream CI and Catalog succeeded; no merge, deployment or fork closure is requested.
Exact upstream validation — 2026-10-30 21:13 UTC
Exact head
a92afee2fba53ce2115b428294ada7013e198c94: Cross-platform CI41127490376 and Catalog41127490241 succeeded. Hygiene passed; current dev remains c34d26f and branch is zero behind, mergeable, with zero inline threads. CodeRabbit initially skipped while Draft, not approval. The subsequent Ready-event review completed on this exact head with no actionable comments and minimal assessed risk; zero inline threads at 2026-10-30 21:37 UTC. Its docstring-coverage warning remains recorded and is not an approval by maintainers. Native-policy skips are not native runtime validation, and the local test-budget/coverage limits above remain.Summary by CodeRabbit